package com.bruce.pattern.behavioral.command;

import org.junit.Test;

/**
 * Created by bruce on 2018/11/11 14:28
 */
public class MainTest {

    @Test
    public void test1() {
        CourseVideo courseVideo = new CourseVideo("设计模式");

        Command openCommand = new OpenCourseVideoCommand(courseVideo);

        Command closeCommand = new CloseCourseVideoCommand(courseVideo);

        Staff staff = new Staff();

        staff.addCommand(openCommand);
        staff.addCommand(closeCommand);

        staff.addCommand(courseVideo::open);
        staff.addCommand(courseVideo::close);


        staff.execute();


    }


}
